package com.cool.springcloud.service;

import com.cool.springcloud.entity.PaymentEntity;
import com.cool.springcloud.utils.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/9/7 16:04
 * @Version 1.0.0
 * @Description
 **/
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface OpenfeignPaymentService {

    /**
     * 插入一个
     *
     * @param payment 付款
     * @return {@link AjaxResult}<{@link Integer}>
     */
    @PostMapping("/payment/insertOne")
    AjaxResult<Integer> insertOne(@RequestBody PaymentEntity payment);

    /**
     * 得到一个
     *
     * @param id id
     * @return {@link AjaxResult}<{@link PaymentEntity}>
     */
    @GetMapping("/payment/getOne/{id}")
    AjaxResult<PaymentEntity> getOne(@PathVariable("id") Long id);

    @GetMapping("/payment/timeout")
    AjaxResult<String> timeoutRestful();
}
